﻿using Infrastructure.Common.Config;
using Infrastructure.Common.Config.Imp;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TallyBook.Test
{
    [TestClass]
    public class ConfigTest
    {
        [TestMethod]
        public void TestSave()
        {
            IConfigManage config = new XmlManager();
            config.Save(new User {Name = "Skyven", Gender = "Male"}, "user.xml");
        }


        [TestMethod]
        public void TestLoad()
        {
            IConfigManage config = new XmlManager();
            User user;
            config.Load("user.xml", out user);
        }


        //ok
        [TestMethod]
        public void GetAppConfig()
        {
            var config = new AppConfig();
            config.GetAppConfig("userName");
        }

        //ok
        [TestMethod]
        public void UpdateAppConfig()
        {
            var config = new AppConfig();
            config.UpdateAppConfig("fafda", "fdafe");
        }

        [TestMethod]
        public void GetappSettings()
        {
            var config = new SettingsConfig();
            config.WR_UserScope();
        }
    }

    public class User
    {
        public string Name { get; set; }

        public string Gender { get; set; }
    }
}